package WebServices;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class TestClient
{
   public static void main(String [] args) 
   {
       try {
           String endpoint = 
    	   "http://nagoya.apache.org:5049/axis/services/echo";
           //	String endpoint = "http://192.168.0.101:8080/axis/services/Version?wsdl";
           //	String endpoint = "http://192.168.0.101:8080/axis/Solver/KSNetSlice.jws";
           //	String endpoint = "http://192.168.0.101:8080/axis/services/Version";
     
           Service  service = new Service();
           //	System.out.println( "Point # 0" );
           Call     call    = (Call) service.createCall();
           //	System.out.println( "Point # 1" );

           call.setTargetEndpointAddress( new java.net.URL( endpoint ) );
           //	call.setOperationName(new QName( "http://soapinterop.org/", "echoString") );
           //	call.setOperationName(new QName( "http://192.168.0.101:8080/axis/services/Version/", "getVersion" ) );
           call.setOperationName(new QName( "getVersion" ) );
           //call.setOperationName(new QName( "getContext" ) );
           
           //	call.setOperationName(new QName( "http://192.168.0.101:8080/axis/services/Version/", "getVersion" ) );

           // Call to addParameter/setReturnType as described in user-guide.html
           //call.addParameter("testParam",
           //                  org.apache.axis.Constants.XSD_STRING,
           //                  javax.xml.rpc.ParameterMode.IN);
           //call.setReturnType(org.apache.axis.Constants.XSD_STRING);
           int [] iClasses = new int[] { 11, 12 } ;  

           String ret = (String) call.invoke( 
        		   new Object[] { iClasses, iClasses, 11, "Hello!" } 
        		   );
           //	String ret = (String) call.invoke( new Object[] { "Hello!" } );

           System.out.println("got '" + ret + "'");
           
       } catch (Exception e) {
           System.err.println(e.toString());
       }
   }
}
